package com.neo.base.traitTest.traitBase

/**
  * Created by hadoop on 6/15/17.
  */
object UseFriend {
  def main(args: Array[String]): Unit = {
    val xiaoming = new Man("xiaoming")
    val feifei = new Woman("feifei")
    val ergou  = new Dog("ergou")

    xiaoming.listen()
    feifei.listen()
    ergou.listen()

    val mansBestFriend : Friend = ergou

    ergou.listen()

    def helpAsFriend(friend: Friend) = friend listen()
    helpAsFriend(feifei)
    helpAsFriend(ergou)
  }
}
